package com.zhcd.sys.controller;


import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.zhcd.sys.service.ChargeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author feifei
 * @since 2021-11-29
 */
@RestController
@RequestMapping("/sys/charge")
public class ChargeController {
    @Autowired
    public ChargeService chargeService;

    //查询全部收费明细
    @RequestMapping(value = "/getAll_Charge",method = RequestMethod.GET)
    @ResponseBody
    public String getAll_Charge() throws JsonProcessingException {
        HashMap<String,Object> hs=new HashMap<>();
        hs.put("code","200");
        hs.put("data",chargeService.getAll_Charge());
        ObjectMapper objectMapper=new ObjectMapper();
        return objectMapper.writeValueAsString(hs);
    }
}

